<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        function Dog() {

        }

        Dog.prototype.say = function() {}


        Dog.isDog = '是一只狗子' ;

        Dog.from = function() {
            console.log(666);
        }


        const d = new Dog() ;
        console.log(d);

        console.log(d.isDog);

        Dog.from()


        d.age = 3 ;   // 属于d的私有属性

        // Dog.prototype.age = 3 ;   所有的实例化对象都拥有此属性



        const d2 = new Dog() ;

        console.log(d2.age); 










        // 静态的属性和方法都属于类的私有属性和方法

        class Cat {
            // 静态的
            static age = 3 ;

            constructor() {
                this.name = 'cc' ;
            
            }

            static say() {
                console.log(666);
            }
        }


        const c = new Cat() ;
        Cat.say()

        console.log(Cat.age);





    </script>
    
</body>
</html>